A compiler generally includes a frontend that translates source code into an intermediate form. An intermediate form processor optimizes the intermediate form. A backend then converts the optimized intermediate form code into, typically, machine language code. A reference, that teaches source-to-source translation and translation after mapping to a smaller intermediate code, is A. V. Aho, R. Sethi, and J. D. Ullman, “Compilers Principles, Techniques, and Tools”, Addison-Wesley Publishing Company, Reading, Massachusetts, 1988. Reference is made to chapter 1, that introduces compiling, to chapter 3, section 1 regarding lexical analyzers, to chapter 4, sections 1 and 2 dealing with parsers and context-free grammars, to chapter 8, section 1 dealing with intermediate languages, to the introduction of chapter 9 on code generation generally, and to the introduction to chapter 10 on code optimaization. intermediate compile mechanism that performs wide compilation functions without changing existing program makefiles. The intermediate compile mechanism supports cross-module inline substitutions and passing of arguments to registers, to improve execution times of executable programs.
U.S. Pat. No. 6,253,370 (Abadi et al), issued Jun. 26, 2001, teaches a method and apparatus that can be applied in a pre-compiler environment to annotate a computer program to facilitate subsequent processing of a program. Code representing the program is generated at a first computer system. Annotations are generated for the code that provide information about the code. At a second computer, the code is processed according to the information provided by the annotations. The annotations, for example, can indicate a control flow graph representing a flow of execution of the code. Also, the information provided by the annotations can be a register allocation that maps data structures of the code to registers of the second computer system.
UPC is a parallel extension to ANSI C, based on a distributed, shared-memory programing paradigm. It provides a common syntax and semantics for writing high-perfomance, explicitly parallel programs in C. An example of UPC is taught by T. A. El-Ghazawi, W. W. Carlson, and J. M. Draper, “UPC Language Specifications V1.1”, issued Mar. 24, 2003, as a joint work, by the University of California Berkerley and the National Energy Research Scientific Computing Center, Lawrence Berkely National Laboratory, Office of Science, US Department of Energy.
UPC has a number of constructs in addition to ANSI C. They can be classified into three categories:    1. Data types—shared, strict and relaxed with blocking factors.    2. Statements—forall    3. Synchronization constructs—barrier, lock, etc.
A convenient approach to implementing UPC compiler using an existing C-compiler, is to define a UPC run-time library that can be targeted by a compiler in generating code. The amount of code generation required of the compiler is substantial, involving generation at points of declaration, initialization, read and write of shared entities. In a document authored by Wei Chen, “The Berkely UPC Compiler”, published at the Open64 User Forum, International Symposium on Code Generation and Optimization, San Francisco, Calif., in March 2003, it is taught that proxy data structures are used to represent shared entities, and communication for read and write of the shared entities is carried out with reference to these proxy (but ordinary C) data structures. Manipulating (e.g. initializing proxy, initializing remote data, communication via proxy) a proxy involves manipulating its internal fields and values, which has to be reflected in the generated code. In order to be compiler independent, the Chen reference chooses a C-level intermediate form in which reads and writes are transformed into calls in a runtime library.
The need exists, however, for a compiler to further ease the code generation aspects of translating UPC programs and to correctly handle UPC program constructs. This is particularly so for nested forall statements.